package com.central.apps.controller;

import com.central.app.common.feign.WorkflowClient;
import com.central.app.service.HandlerService;
import com.central.apps.service.impl.MobilePictureServiceImpl;
import com.central.apps.util.CloseFlowUtil;
import com.central.common.web.Result;
import io.swagger.annotations.Api;
import net.sf.json.JSONObject;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController

@RequestMapping("/mobilepicture")
public class MobilePictureController {

    @Autowired
    private MobilePictureServiceImpl mobilePictureService;


    @PostMapping("/insert")
    public com.central.common.web.Result insert(@RequestBody List<Map<String,Object>> params){
        try {
            mobilePictureService.insert(params);
            return Result.succeed("保存成功");
        }catch (Exception e){
            return Result.failed("保存失败");
        }
    }

    @PostMapping("/queryIdByItemBach")
    public com.central.common.web.Result queryIdByItemBach(@RequestBody Map<String,Object> params){
        try {
            String prtdetaillineid = mobilePictureService.queryIdByItemBach(params);
            return Result.succeed(prtdetaillineid,"成功查询");
        }catch (Exception e){
            return Result.failed("查询失败");
        }
    }

    /**
     * pc端展示图片
     * @param params
     * @return
     */
    @PostMapping("/queryPicUrlById")
    public com.central.common.web.Result queryPicUrlById(@RequestBody Map<String,Object> params){
        try {
            List<Map<String, Object>> picUrlList = mobilePictureService.queryPicUrlById(params);
            return Result.succeed(picUrlList,"成功查询");
        }catch (Exception e){
            return Result.failed("查询失败");
        }
    }


}

